package com.atguigu.boot.activemq.config;


import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.stereotype.Component;

import javax.jms.Queue;


/**
 * @Auther 赵乾坤
 * @Date 2021-04-17 10:07
 */
@Component
@EnableJms//开启JMS
public class ConfigBean {

    @Value("${myqueue}")//防止硬编码  在配置文件修改
    private String myQueue;

    @Bean
    public Queue queue() {
        return  new ActiveMQQueue(myQueue);
    }
}
